﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Web.master" AutoEventWireup="true"
    CodeFile="MenuManage.aspx.cs" Inherits="Systems_MenuManage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script src="../Scripts/validform.js" type="text/javascript"></script>
    <script src="../Scripts/YJPopup.js" type="text/javascript"></script>
    <script src="../Scripts/GiveTip.js" type="text/javascript"></script>
    <script type="text/javascript">
        var MyPopup;
        $(function () {
            $.checkForm();
            MyPopup = new YJPopup({
                contentDivID: "NsContentDiv",
                dragBarDivID: "NsDragBar",
                dragable: true,
                autoCreate: true
            })
        });
        function ShowPopup(ID) {
            MyPopup.Show("600px", "200px", "修改", "MenuModify.aspx?ID=" + encodeURIComponent(ID) + "&_" + Math.random());
        }
        function RoleMsg(ID) {
            MyPopup.Show("600px", "200px", "权限设置", "MenuRole.aspx?ID=" + encodeURIComponent(ID) + "&_" + Math.random());
        }
        function ClosePopup() {
            MyPopup.Hide();
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table class="tabContent">
        <tr>
            <th lang="th">
                菜单添加
            </th>
        </tr>
        <tr>
            <td lang='td'>
                <table style="border-collapse: separate" cellpadding="2">
                    <tr>
                        <td>
                            菜单名称：
                        </td>
                        <td>
                            <NC:FTextBox ID="txtMenuName" runat="server" CheckGroup="Add" />
                        </td>
                        <td>
                            路径：
                        </td>
                        <td>
                            <NC:FTextBox ID="txtMenuUrl" runat="server" Width="300px" CheckGroup="Add" EnableNull="true" />
                        </td>
                        <td>
                            排序：
                        </td>
                        <td>
                            <NC:FTextBox ID="txtOrderID" Width="50px" runat="server" Text="0" CheckGroup="Add"
                                CheckType="Int" />
                        </td>
                        <td valign="middle" align="center">
                            <asp:Button ID="btnAdd" runat="server" CheckGroup="Add" Text="添加" CssClass="btn"
                                OnClick="btnAdd_Click" />
                            <asp:Button ID="btnBindData" runat="server" Text="更新" uncheck="true" CssClass="hidden"
                                OnClick="btnBindData_Click" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <th colspan="4" lang="th">
                菜单列表
            </th>
        </tr>
        <tr>
            <td lang="td">
                <table style="border-collapse: separate" cellpadding="4" cellspacing="4" width="100%">
                    <tr>
                        <td>
                            <asp:Label ID="LabPath" runat="server"></asp:Label>
                        </td>
                    </tr>
                </table>
                <NC:FGridView ID="FGridView1" runat="server" AutoCreateNumber="true" AutoGenerateColumns="false"
                    ShowFooter="true" DataKeyNames="MenuID" PageSize="20">
                    <Columns>
                        <asp:TemplateField HeaderText="菜单名称" ItemStyle-Width="200px">
                            <ItemTemplate>
                                <a href='MenuManage.aspx?mid=<%# Request.QueryString["mid"] %>&ParentID=<%# Eval("MenuID") %>'>
                                    <%# Eval("MenuName")%></a>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField HeaderText="路径" DataField="MenuLink" />
                        <asp:BoundField HeaderText="排序" DataField="OrderID" ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Center" />
                        <asp:TemplateField HeaderText="权限" ItemStyle-Width="50px" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <input type="button" value="设置" id="btnUpdate" onclick="RoleMsg(<%# Eval("MenuID") %>);"
                                    class="Gridbtn">
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="操作" ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <input type="button" value="修改" id="btnUpdate" onclick="ShowPopup(<%# Eval("MenuID") %>);"
                                    class="Gridbtn">
                                <asp:Button runat="server" Text="删除" ID="btnDel" uncheck="true" OnClientClick="GiveTip(event,'您确定删除吗？');"
                                    OnClick="btnDel_Click" CommandArgument='<%# Eval("MenuID") %>' class="Gridbtn" />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </NC:FGridView>
            </td>
        </tr>
    </table>
</asp:Content>
